package com.axungu.web.controller;

import com.axungu.common.Result;
import com.axungu.core.patchca.SimpleCaptchaService;
import com.axungu.core.oauth.OauthInfo;
import com.axungu.core.oauth.OauthService;
import com.axungu.core.oauth.Permission;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/oauth")
public class OauthController {

    @Autowired
    private SimpleCaptchaService simpleCaptchaService;

    @Autowired
    private OauthService oauthService;

    @Value("${login.password}")
    private String loginPassword;


    @Permission
    @GetMapping("/getOauthInfo")
    public Result getOauthInfo() {
        OauthInfo oauthInfo = this.oauthService.getOAuth();
        return Result.instance(Result.Code.SUCCESS).setData(oauthInfo);
    }

}
